/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.stat;

import android.text.TextUtils;
import java.util.Vector;

public class y {
    public static Vector a = null;
    public static boolean b = false;

    public static void a(k paramk) {
        if (TextUtils.isEmpty(paramk.a))
            return;
        if (a == null)
            a = new Vector();
        k localk = null;
        int i = 0;
        int j;
        if (paramk.e == 1) {
            for (j = 0; j < a.size(); ++j) {
                localk = (k) a.get(j);
                if ((!(localk.a.equals(paramk.a))) || (localk.e != 1))
                    continue;
                localk = paramk;
                i = 1;
                break;
            }
            if (i != 0)
                return;
            a.add(paramk);
            b = true;
        }
        else {
            j = 0;
            for (int k = 0; k < a.size(); ++k) {
                localk = (k) a.get(k);
                if ((!(localk.a.equals(paramk.a))) || (localk.e != 1))
                    continue;
                j = 1;
                a.remove(localk);
                break;
            }
            if (j == 0)
                return;
            paramk.c = paramk.b;
            paramk.b = localk.b;
            for (k = 0; k < a.size(); ++k) {
                localk = (k) a.get(k);
                if ((!(localk.a.equals(paramk.a))) || (localk.e != paramk.e) || (localk.d >= 0L))
                    continue;
                i = 1;
                break;
            }
            if (i != 0)
                return;
            paramk.d = (paramk.c - paramk.b);
            a.add(paramk);
            b = true;
        }
    }

    public static void a() {
        if (a != null) {
            for (int i = 0; i < a.size(); ++i) {
                if (1 == ((k) a.get(i)).e)
                    continue;
                a.remove(i);
                --i;
            }
            if (a.size() == 0) {
                a.clear();
                a = null;
            }
        }
        b = false;
    }
}